package com.hzhr.iot.core.constant;

public enum AccessModeEnum {
    NORMAL(0), GLOBAL(1);

    private Integer code;
    AccessModeEnum(Integer code) {
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public static AccessModeEnum getEnumByCode(Integer code) {
        if (code == null) return null;
        for (AccessModeEnum accessModeEnum:
             AccessModeEnum.values()) {
            if (accessModeEnum.getCode().equals(code)) {
                return accessModeEnum;
            }
        }
        return null;
    }
}
